<template>
  <div class="ke">
    <div class="powertop">
      <router-link class="powertopli powertopact" to="/yongjinzhichu/zhichuguanli">支出订单管理</router-link>
      <router-link class="powertopli " to="/yongjinzhichu/yongjinzhichu">佣金支出</router-link>
      <router-link class="powertopli " to="/yongjinzhichu/zhichudakuan">支出打款</router-link>
    </div>
    <div v-loading='loading' style="padding: 20px;">
      <div class="kflexc">
        <div style="width: 250px; margin-right: 20px; margin-bottom: 20px;">

          <el-select clearable v-model="all.merchant_name"  style="width: 250px;" filterable placeholder="选择分销商">
            <el-option :label="item.name" :value="item.child_shop_id"  v-for="item in fenxiaoshanglists" :key="item.child_shop_id" ></el-option>
          </el-select>
        </div>
        <div style="width: 250px; margin-right: 20px; margin-bottom: 20px;">
          <!-- <el-input v-model="all.cm_name" placeholder="客户经理"></el-input> -->
          <el-select  v-model="all.cm_name" style="width: 250px;" placeholder="选择客户经理" filterable clearable>
            <el-option :label="item.name" :value="item.id"  v-for="item in kehujinglilists" :key="item.id" ></el-option>
          </el-select>
        </div>
        <!-- <div style="width: 250px; margin-right: 20px; margin-bottom: 20px;">
          <el-input v-model="all.status" placeholder="状态"></el-input>
        </div> -->
        <el-button type="danger" round  style="margin-right: 20px; margin-bottom: 20px;" @click="search()">搜索</el-button>

      </div>
      <div class="kflexc">
        <el-button type="danger" round style="margin-right: 20px;">批量进入支出审核</el-button>
      </div>
      <el-table :data="list" border style="width: 100%; margin: 20px 0;" ref="multipleTable" @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column align='center' prop='merchant_name' label="分销商"></el-table-column>
        <el-table-column align='center' prop='orders_count' label="待核算订单"></el-table-column>
        <el-table-column align='center' prop='sum_commission' label="待核算金额"></el-table-column>
        <el-table-column align='center' prop='withdraw_at' label="最近一次佣金结算时间"></el-table-column>
        <el-table-column align='center' label="操作">
          <template slot-scope="scope">
            <el-button type="text"  @click="xiazai(scope.row)">下载明细</el-button>
            <el-button type="text"  @click="zhichu(scope.row)">确认支出</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination style="text-align: right;" background layout="total,prev, pager, next" :current-page="all.page" @current-change="fanye" :page-size="all.page_size" :total="total"></el-pagination>
    </div>
    <el-dialog title="返利领取记录" center :visible.sync="log" :close-on-click-modal="false" width="1200px">
      <el-table :data="list2" border style="width: 100%; margin: 20px 0;">
        <el-table-column align='center' prop='month' label="月份"></el-table-column>
        <el-table-column align='center' prop='status_name' label="领取状态"></el-table-column>
        <el-table-column align='center' prop='rebate_amount' label="金额"></el-table-column>
        <el-table-column align='center' prop='operator_at' label="登记时间"></el-table-column>
        <el-table-column align='center' prop='rebate_status_name' label="充值状态"></el-table-column>
        <el-table-column align='center' prop='remark' label="失败原因"></el-table-column>
        <el-table-column align='center' prop='rebate_at' label="到账时间"></el-table-column>
        <el-table-column align='center' label="登记返利">
          <template slot-scope="scope">
            <el-button v-if="vsdate(scope.row.month,nowdateym)" type="text" :disabled="!(scope.row.status <10)" @click="querenlingqu(scope.row)">登记返利</el-button>
            <el-button v-else type="text" :disabled="!(scope.row.status <10)" @click="querenlingqu(scope.row)"></el-button>
          </template>
        </el-table-column>
      </el-table>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" round @click="log = false">好的</el-button>
      </div>
    </el-dialog>

    <el-dialog title="发票配置" :visible.sync="log" width="840px" :close-on-click-modal="false" :close-on-press-escape="false">
      <div style="font-size: 18px; margin-bottom: 20px;">发票类型</div>
      <div style="margin-bottom: 20px;">
        <div class="flexc" v-for="item in fapiaoall.configs.data" :key="item.type" style="margin-bottom: 10px;">
          <div style="margin-right: 20px;"><el-checkbox v-model="item.ok" :true-label="1" :false-label="0"></el-checkbox></div>
          <div style="margin-right: 40px;">{{item.name}}</div>
          <div v-if="item.type != 4 && item.type != 5">税点{{toPercent(item.tax,0)}}</div>
          <div v-if="item.type == 4">
            <el-select clearable filterable style="width: 200px; margin-right: 30px;" v-model="item.tax" placeholder="请选择">
              <el-option  label="1%"  :value="0.01"></el-option>
              <el-option  label="2%"  :value="0.02"></el-option>
              <el-option  label="3%"  :value="0.03"></el-option>
              <el-option  label="4%"  :value="0.04"></el-option>
              <el-option  label="5%"  :value="0.05"></el-option>
              <el-option  label="6%"  :value="0.06"></el-option>
            </el-select>

          </div>

          <div style="margin-left: 20px; color: #bbb;" v-if="item.desc != 0">({{item.desc}})</div>
        </div>
      </div>
      <div style="display: flex;font-size: 13px;margin-bottom: 30px;">
        <div>扣税方式：</div>
        <el-radio v-model="ksradio" :label="1">
          <div style="display: inline-grid;" >
            <div style="font-weight: normal;">按照标准税务计算方式扣除</div>
            <div style="font-weight: normal;color: #C0C4CC;margin-top: 10px;">计算公式：提现金额÷1.06*（6%-开票税点）</div>
          </div>
        </el-radio>
        <el-radio v-model="ksradio" :label="2">
          <div style="display: inline-grid;">
            <div style="font-weight: normal;">按照粗略方式扣除</div>
            <div style="font-weight: normal;color: #C0C4CC;margin-top: 10px;">扣除计算公式：提现金额×（6%-开票税点)</div>
          </div>
        </el-radio>
      </div>
      <div style="font-size: 18px; margin-bottom: 20px;">开票信息</div>
      <div style="font-size: 12px; margin-bottom: 30px;">
        <el-input type="textarea" :rows="5" placeholder="请输入内容" v-model="fapiaoall.info"></el-input>
      </div>
      <div style="font-size: 18px; margin-bottom: 20px;">邮寄地址</div>
      <div class="flexc" style="margin-bottom: 20px;">
        <div style="width: 100px; text-align: right; color: rgb(42, 42, 42); font-size: 14px; margin-right: 15px;">输入收件人</div>
        <div><el-input v-model="fapiaoall.addr_name" style="width: 200px; margin-right: 30px;" placeholder="请输入收件人"></el-input></div>
      </div>
      <div class="flexc" style="margin-bottom: 20px;">
        <div style="width: 100px; text-align: right; color: rgb(42, 42, 42); font-size: 14px; margin-right: 15px;">联系电话</div>
        <div><el-input v-model="fapiaoall.addr_mobile" style="width: 200px; margin-right: 30px;" placeholder="请输入联系电话"></el-input></div>
      </div>
      <div class="flexc" style="margin-bottom: 20px;">
        <div style="width: 100px; text-align: right; color: rgb(42, 42, 42); font-size: 14px; margin-right: 15px;">收件地址</div>
        <div class="flex">
          <el-input v-model="fapiaoall.addr_province" style="width: 120px; margin-right: 30px;" placeholder="请输入" @focus="show = true"></el-input>
          <el-input v-model="fapiaoall.addr_city" style="width: 120px; margin-right: 30px;" placeholder="请输入" @focus="show = true"></el-input>
          <el-input v-model="fapiaoall.addr_district" style="width: 120px; margin-right: 30px;" placeholder="请输入" @focus="show = true"></el-input>
        </div>
      </div>
      <div class="flexc" style="margin-bottom: 20px;">
        <div style="width: 100px; text-align: right; color: rgb(42, 42, 42); font-size: 14px; margin-right: 15px;">&nbsp;</div>
        <div class="flex">
          <el-input v-model="fapiaoall.addr" style="width: 420px; margin-right: 30px;" placeholder="请输入"></el-input>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button round @click="log = false">关闭</el-button>
        <el-button round type="primary" @click="peizhi">确定</el-button>
      </span>
    </el-dialog>

    <el-dialog :title="tixianren" :visible.sync="log2" width="800px" :close-on-click-modal="false" :close-on-press-escape="false">
      <div style="font-size: 18px; margin-bottom: 20px; font-weight: bold;">提现金额</div>
      <div style="background: rgb(255, 245, 245);border-radius: 10px; padding: 20px; justify-content: space-around; margin-bottom: 20px;" class="flexc" >
        <div style="text-align: center;">
          <div style="color:rgb(64, 66, 71); font-size: 16px; margin-bottom: 10px;">提现金额</div>
          <div style="color:rgb(254, 61, 61); font-size: 16px; font-weight: bold;">￥{{all2.sum_commission}}</div>
        </div>
        <div style="text-align: center;">
          <div style="color:rgb(64, 66, 71); font-size: 16px; margin-bottom: 10px;">增值税税额</div>
          <div style="color:rgb(254, 61, 61); font-size: 16px; font-weight: bold;">￥{{all2.tax_amount}}</div>
        </div>
        <div style="text-align: center;">
          <div style="color:rgb(64, 66, 71); font-size: 16px; margin-bottom: 10px;">实际到账金额</div>
          <div style="color:rgb(254, 61, 61); font-size: 16px; font-weight: bold;">￥{{all2.withdraw_amount}}</div>
        </div>
      </div>
      <div style="font-size: 18px; margin-bottom: 20px; font-size: 14px;">开票类型：{{all2.invoice_info}}</div>

      <div style="font-size: 18px; margin-bottom: 20px; font-weight: bold;" v-if="all2.collect_type == 1">收款账户</div>
      <div style="margin-bottom: 20px;" v-if="all2.collect_type == 1">

        <div class="flex" style="margin-bottom: 20px;">

          <div style="width: 220px;">卡号：{{all2.bank_no}}</div>
          <div style="width: 220px;">开户人：{{all2.bank_name}}</div>
          <div style="width: 220px;">身份证号：{{all2.bank_idcard}}</div>
        </div>
        <div class="flex">
          <div style="width: 220px;">开户行：{{all2.bank}}</div>
          <div style="width: 220px;">开户支行行：{{all2.bank_sub}}</div>
        </div>
      </div>
      <div v-if="lurutype==1" style="font-size: 18px; margin-bottom: 20px; font-weight: bold;" >打款信息</div>
      <div v-if="lurutype==1" style="margin-bottom: 20px;" >
        <div  style="margin-bottom: 20px;">
          <div style="width: 220px;margin-bottom: 20px;font-weight: bold;">
            <span>{{ all2.withdraw_at }}</span>，
            <span v-if="all2.status==10">已打款</span>
            <span v-if="all2.status==0">待打款</span>
            <span v-if="all2.status==1">打款失败</span>
            <span v-if="all2.status==2">打款中</span>

          </div>
          <div style="width: 220px;">
            打款方式：
            <span v-if="all2.pay_way==0&&all2.status != 0">未知</span>
            <span v-if="all2.pay_way==0&&all2.status == 0">-</span>
            <span v-if="all2.pay_way==1">线下</span>
            <span v-if="all2.pay_way==2">云账户</span>
            <span v-if="all2.pay_way==3">支付宝</span>
          </div>
          <div v-if="all2.pay_way==2" style="width: 220px;margin-bottom: 20px;margin-top: 20px;">打款订单ID：{{all2.payment_txn}}</div>
        </div>
      </div>
      <div style="font-size: 18px; margin-bottom: 20px; font-weight: bold;" v-if="all2.collect_type == 1">上传打款截图</div>
      <div v-if="!all2.withdraw_pic && all2.collect_type == 1" class="flexcc" style="width: 100%; height: 220px; background: rgb(246, 248, 251);" >
        Ctrl+V直接粘贴截图
      </div>
      <div v-if="all2.withdraw_pic && all2.collect_type == 1" class="flexcc" style="width: 100%; background: rgb(246, 248, 251);">
        <img :src="all2.withdraw_pic" style="max-width: 100%;">
      </div>

      <div style="margin-bottom: 20px;" v-if="all2.collect_type == 2">
        <div class="flex" style="margin-bottom: 20px;">
          <div style="width: 220px;">支付宝号：{{all2.ali_no}}</div>
          <div style="width: 220px;">姓名：{{all2.ali_name}}</div>
          <div style="width: 220px;">身份证号：{{all2.ali_idcard}}</div>
        </div>
      </div>
      <div style="font-size: 18px; margin-bottom: 20px; font-weight: bold;" v-if="all2.collect_type == 2">转账备注</div>
      <el-input v-model="all2.withdraw_remark" style="width: 320px; margin-right: 30px;" placeholder="请输入" v-if="all2.collect_type == 2"></el-input>
      <span slot="footer" class="dialog-footer">
        <el-button round @click="log2 = false">关闭</el-button>
        <el-button round type="primary" @click="quedingdakuan">打款完成</el-button>
      </span>
    </el-dialog>

    <el-dialog title="查看发票" :visible.sync="log6" width="820px" :close-on-click-modal="false" :close-on-press-escape="false">
      <div v-if="log6fapiao.invoice_way == 2" style="margin-bottom: 20px;">
        物流公司：{{log6fapiao.track_company}}
      </div>
      <div v-if="log6fapiao.invoice_way == 2">
        物流单号：{{log6fapiao.track_no}}
      </div>
      <div v-if="log6fapiao.invoice_way == 1">
        <a :href="log6fapiao.invoice_img" target="_blank" style="color: rgb(0, 90, 255);">{{log6fapiao.invoice_img}}</a>
      </div>
      <div v-if="log6fapiao.invoice_way == 1" class="flexcc" style="margin: 20px 0;"><el-button round plain type="primary" @click="down(log6fapiao.invoice_img)">下载</el-button></div>

      <span slot="footer" class="dialog-footer">
        <el-button round @click="log6 = false">关闭</el-button>
      </span>
    </el-dialog>
    <!-- 云账户打款弹窗 -->
    <el-dialog
      title="云账户打款"
      :visible.sync="isshowyzhpay"
      :close-on-click-modal="false"
      width="400px">
      <div style="text-align: center;font-size: 16px;">
        <div style="margin-bottom:30px">您将使用云账户支付：￥{{ iscanpayinfo.withdraw_amount }}</div>
        <div style="font-weight: bold;">
          云账户余额：{{ iscanpayinfo.total_balance }}元
          <span v-if="iscanpayinfo.total_balance*1>=iscanpayinfo.withdraw_amount*1" style="margin-left: 10px;color: #67C23A;">充足</span>
          <span v-else style="margin-left: 10px;color: #EEF7FF;">不足</span>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button round @click="isshowyzhpay = false">取 消</el-button>
        <el-button :disabled="iscanpayinfo.total_balance*1<iscanpayinfo.withdraw_amount*1" round type="primary" @click="surepay">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 支付宝打款弹窗 -->
    <el-dialog
      title="支付宝打款"
      :visible.sync="isshowyzhpay2"
      :close-on-click-modal="false"
      width="400px">
      <div style="text-align: center;font-size: 16px;">
        <div style="margin-bottom:30px">您将使用支付宝支付：￥{{ rowinfo.withdraw_amount }}</div>
        <div style="font-weight: bold;">
          支付宝余额：{{ iscanpayinfo2.available_amount }}元
          <span v-if="iscanpayinfo2.available_amount*1 >= rowinfo.withdraw_amount*1" style="margin-left: 10px;color: #67C23A;">充足</span>
          <span v-else style="margin-left: 10px;color: #EEF7FF;">不足</span>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button round @click="isshowyzhpay2 = false">取 消</el-button>
        <el-button :disabled="iscanpayinfo2.available_amount*1 < rowinfo.withdraw_amount*1 " round type="primary" @click="surepay2">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
  import axios from 'axios'
  import top from '@/components/top.vue'
  import left from '@/components/left.vue'
  import foot from '@/components/foot.vue'
  import moment from "moment";
  import XLSX from 'xlsx';
  import {
      read,utils
    } from 'xlsx'

  export default {
    components: {
      "left": left,
      "top": top,
      "foot": foot
    },
    name: "ke",
    data() {
      return {
        times:[],
        loading:false,
        list:"",
        list2:"",
        all:{
          end:"",
          mobile:"",
          sourceid:"",
          start:"",
          page:1,
          page_size:20
        },
        total:0,
        log:false,
        nowdateym:'',

        log:false,
        log2:false,
        search:{
          page:1,
          page_size:20,
          merchant_name:"",
          status:'',
          start:"",
          end:""
        },
        list:[],
        total:0,
        all:{
          checkedCities:[]
        },
        widthss:false,
        fapiaoall:{
          configs:""
        },
        fapiaojson:[],
        all2:"",
        times:[],
        log6:false,
        log6fapiao:"",
        tixianren:"提现人",
        isshowyzhpay:false,
        isshowyzhpay2:false,
        rowinfo:'',
        nowmoneyobj:{},
        iscanpayinfo:{},
        iscanpayinfo2:{},
        shoujiban:false,
        loading: false,
        finished: false,
        lurutype:'',
        showdate:false,
        whodata:"",
        minDate: new Date(2023, 0, 1),
        areaList:"",
        show:false,
        ksradio:'',
        zhibaofuyue:0,
        zhifubaom:false,

        kehujinglilists:"",
        fenxiaoshanglists:""
      }
    },
    created() {
      this.getlist()

      //获取客户经理
      axios.get('/api/plan-market/user/userManagerList')
        .then(response => {
          if (response.data.msg.code == 0) {
             this.kehujinglilists = response.data.data
          } else {
             this.$message.error(response.data.msg.info);
          }
      })
      //获取全部分销商
      axios.get('/api/gth/partner/list?page_size=2000')
        .then(response => {
          if (response.data.msg.code == 0) {
            this.fenxiaoshanglists = response.data.data.data
          } else {
            this.$message.error(response.data.msg.info);
          }
        })

    },
    mounted() {

    },
    methods: {

      zhichu:function(item){
        axios.post('/api/plan-market/expend/pool',{
          id:item.id,
          adjust_commission:item.adjust_commission,
          adjust_remark:item.adjust_remark
        })
          .then(response => {
            if (response.data.msg.code == 0) {
              this.$message.success('操作成功');
              this.getlist()
            } else {
              this.$message.error(response.data.msg.info);
            }
          })
      },
      search: function() {
        this.all.page = 1
        this.getlist()
      },
      //翻页
      fanye: function(page) {
        this.loading = true
        this.all.page = page
        this.getlist()
      },
      //获取列表
      getlist: function() {
        axios.get('/api/plan-market/expend/pools',{params:this.all})
          .then(response => {
            if (response.data.msg.code == 0) {
              this.list = response.data.data.data
              this.total = response.data.data.total
              this.loading = false
            } else {
              this.$message.error(response.data.msg.info);
            }
          })
      },


      handleSelectionChange(val) {
        this.multipleSelection = val;
      },
      querenlingqu:function(item){
        const date1 = moment(item.month);
        const now = moment().format('YYYY-MM')
        const date2 = moment(now);
        const diffInHours = date1.diff(date2, 'hours');
        if(diffInHours == 0){
          axios.post('/api/plan-market/fanli/log/operate?id='+item.id)
            .then(response => {
              if (response.data.msg.code == 0) {
                this.$message.success('操作成功');
                this.getlist2()
              } else {
                this.$message.error(response.data.msg.info);
              }
            })
        }else{
          this.$prompt('','请输入申请补领密码', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            center:true,
            roundButton:true
          }).then((val) => {

            if(val.value == '123456'){
              axios.post('/api/plan-market/fanli/log/operate?id='+item.id)
                .then(response => {
                  if (response.data.msg.code == 0) {
                    this.$message.success('操作成功');
                    this.getlist2()
                  } else {
                    this.$message.error(response.data.msg.info);
                  }
                })
            }else{
              this.$message.error('密码错误');
            }
          })
        }
      },
      getlist2: function(item) {
        var that = this
        axios.get('/api/plan-market/fanli/logs?order_id='+item.order_id)
          .then(response => {
            if (response.data.msg.code == 0) {
              that.list2 = response.data.data
            } else {
              that.$message.error(response.data.msg.info);
            }
          })
      },
      chakanxiangqing:function(item){
        this.getlist2(item)
        this.log = true
      },

      timeschange(){
        if(this.times && this.times.length > 0){
          this.all.start = this.times[0]
          this.all.end = this.times[1]
        }else{
          this.all.start = ''
          this.all.end = ''
        }
      },
      readExcel1(files) {
        return new Promise((res, rej) => {
          var that = this;
          if (files.length <= 0) {
            return;
          }
          if (!/\.(xls|xlsx)$/.test(files[0].name.toLowerCase())) {
            this.$Message.error('上传格式不正确，请上传xls或者xlsx格式');
            return;
          }
          const fileReader = new FileReader();
          fileReader.onload = (ev) => {
            try {
              const data = ev.target.result;
              const workbook = read(data, {
                type: 'binary'
              });
              // 取第一张表
              const wsname = workbook.SheetNames[0];
              // 生成json表格内容
              const ws = utils.sheet_to_json(workbook.Sheets[wsname]);
              console.log(ws);
              // 后续为自己对ws数据的处理
              res(ws)
            } catch (e) {
              return false;
              rej(e)
            }
          };
          fileReader.readAsBinaryString(files[0]);
        })

      },
      uploasd(file, fileList) {
        var that = this
        let files = {
          0: file
        }
        let data = []

        let ff = this.readExcel1(files);
        ff.then((res) => {
          console.log(res)
          res.forEach(item => {
            let can = 0
            if(item['是否满足领取'] == '满足'){
              can = 1
            }
            let obj = {
              mobile: item['生产号码'],
              can: can,
              remark: item['不满足原因'],
            }
            data.push(obj)
          })
          axios.post('/api/plan-market/fanli/canrebate/import',{data:data})
            .then(response => {
              if (response.data.msg.code == 0) {
                this.$message.success(`成功导入${response.data.data.success}条`);
                this.getlist()
              } else {
                this.$message.error(response.data.msg.info);
              }
            })
        })
      },
      uploasd2(file, fileList) {
        var that = this
        let files = {
          0: file
        }
        let data = []

        let ff = this.readExcel1(files);
        ff.then((res) => {
          console.log(res)
          res.forEach(item => {
            let suc = 0
            if(item['充值状态'] == '充值成功'){
              suc = 1
            }
            let obj = {
              mobile: item['生产号码'],
              suc: suc,
              remark: item['失败原因'],
            }
            data.push(obj)
          })
          axios.post('/api/plan-market/fanli/result/imp',{data:data})
            .then(response => {
              if (response.data.msg.code == 0) {
                this.$message.success(`导入成功`);
                this.getlist()
              } else {
                this.$message.error(response.data.msg.info);
              }
            })
        })
      },
      //获取导入详情
      uploadx: function() {
        var that = this
        axios.get('/api/plan-market/rebate/import/logs?month=' + this.uptime)
          .then(response => {
            if (response.data.msg.code == 0) {
              that.uploadsuceess = response.data.data[0].success
              that.uploadtimes = response.data.data[0].times
            } else {
              that.$message.error(response.data.msg.info);
            }
          })
      },
      //统计



      //下载模板
      xiazai: function() {
        const a = document.createElement('a');
        a.setAttribute('download', '导入返利状态数据.xlsx');
        a.setAttribute('href',location.origin + location.pathname + 'static/fanlizhuangtai.xlsx');
        a.click();
      },
      //下载模板
      xiazai2: function() {
        const a = document.createElement('a');
        a.setAttribute('download', '导入充值结果.xlsx');
        a.setAttribute('href',location.origin + location.pathname +  'static/fanlichongzhijieguo.xlsx');
        a.click();
      },
      //获取当前年月
      getNowDate(){
        var date = new Date();
        var sign2 = ":";
        var year = date.getFullYear() // 年
        var month = date.getMonth() + 1; // 月
        var day = date.getDate(); // 日
        var hour = date.getHours(); // 时
        var minutes = date.getMinutes(); // 分
        var seconds = date.getSeconds() //秒
        var weekArr = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期天'];
        var week = weekArr[date.getDay()];
        // 给一位数的数据前面加 "0"
        if (month >= 1 && month <= 9) {
          month = "0" + month;
        }
        if (day >= 0 && day <= 9) {
          day = "0" + day;
        }
        if (hour >= 0 && hour <= 9) {
          hour = "0" + hour;
        }
        if (minutes >= 0 && minutes <= 9) {
          minutes = "0" + minutes;
        }
        if (seconds >= 0 && seconds <= 9) {
          seconds = "0" + seconds;
        }
        console.log(year + "-" + month + "-" + day + " " + hour + sign2 + minutes + sign2 + seconds)
        //返回格式2022-11-25 10:25:39
        this.nowdateym = year + "-" + month
        console.log('返回格式日期')
        console.log(this.nowdateym)
      },
      //对比日期
      vsdate(date1,date2){
        // var date1 = '2024-07' //目标
        // var date2 = '2024-06' //当前
        console.log(date1.slice(0,4)*1)//年
        console.log(date1.slice(-2)*1)//月
        if(date1.slice(0,4)*1>date2.slice(0,4)*1){
          return true
        }else if(date1.slice(0,4)*1==date2.slice(0,4)*1){
          if(date1.slice(-2)*1>=date2.slice(-2)*1){
            return true
          }else{
            return false
          }
        }else{
          return false
        }


      }
    }
  }
</script>

<style lang="scss" scoped>
  .ke {
    .powertop {
    	display: flex;
    	background:#f9f9f9;
    }
    .powertopli {
    	flex-basis: 180px;
    	line-height: 50px;
    	border-bottom: 3px #F9F9F9 solid;
    	color: #727272;
    	border-right: 1px #F9F9F9 solid;
    	font-size: 16px;
    	text-align: center;
    }
    .router-link-active {
    	background: #FFFFFF;
    	border-bottom: 3px #2974FF solid;
    }
    /deep/ .el-pagination.is-background .btn-prev:disabled{ background: rgba(246, 246, 246, 0.3); border: 1px rgba(167, 167, 167, 0.3) solid;}
    /deep/ .el-pagination.is-background .btn-next:disabled{ background: rgba(246, 246, 246, 0.3); border: 1px rgba(167, 167, 167, 0.3) solid;}
    /deep/ .el-pagination.is-background .btn-next{ background: rgba(246, 246, 246,1); border: 1px rgba(167, 167, 167,1) solid;}
    /deep/ .el-pagination.is-background .btn-prev{ background: rgba(246, 246, 246,1); border: 1px rgba(167, 167, 167,1) solid;}
    /deep/ .el-pagination.is-background .el-pager li:not(.disabled).active{ background-color: #2974FF;}
    /deep/ .el-pagination.is-background .el-pager li:not(.disabled).active:hover {
        color: #fff;
    }
    /deep/ .el-pagination.is-background .el-pager li:not(.disabled):hover {
        color: #2974FF;
    }
    /deep/ .el-pager li{ border-radius: 14px; background: rgba(255, 255, 255, 1); border: 1px rgba(167, 167, 167, 0.3) solid;}
    /deep/ .btn-prev{ border-radius: 14px; padding: 0 10px;}
    /deep/ .btn-next{ border-radius: 14px; padding: 0 10px;}

    /deep/ .el-table th{ background: rgb(246, 246, 246);}
    /deep/ .el-input__inner{ line-height: 36px; height: 36px; font-size: 12px; background: rgb(247, 248, 250);  border: 0;}
    /deep/ .el-date-editor .el-range-input{ background: rgb(247, 248, 250); }
    /deep/ .el-button{ padding: 11px 23px !important;}
    /deep/ .el-button--mini{ padding: 6px 15px !important;}
    /deep/ .el-button--danger {
        color: #FFF;
        background-color: #2974FF;
        border-color: #2974FF;
    }
    .team {
    	background: #F9F9F9;
    }
  }
</style>
